import hack from 'tweetnacl'
import hackUtil from 'tweetnacl-util'

export const hackRequestParams = (() => {
  function _0x2acc(_0x1e2ef1, _0x1e954b) {
    const _0x13fa11 = _0x13fa()
    return (
      (_0x2acc = function (_0x2acc44, _0x23b1cc) {
        _0x2acc44 = _0x2acc44 - 0x11b
        let _0x2d7e60 = _0x13fa11[_0x2acc44]
        return _0x2d7e60
      }),
      _0x2acc(_0x1e2ef1, _0x1e954b)
    )
  }
  ;(function (_0x98fe9a, _0x1b9f7e) {
    const _0xacfd6d = _0x2acc,
      _0x530b30 = _0x98fe9a()
    while (!![]) {
      try {
        const _0x467867 =
          (-parseInt(_0xacfd6d(0x127)) / 0x1) * (parseInt(_0xacfd6d(0x12e)) / 0x2) +
          parseInt(_0xacfd6d(0x124)) / 0x3 +
          (-parseInt(_0xacfd6d(0x129)) / 0x4) * (parseInt(_0xacfd6d(0x12d)) / 0x5) +
          (parseInt(_0xacfd6d(0x12b)) / 0x6) * (-parseInt(_0xacfd6d(0x11d)) / 0x7) +
          (parseInt(_0xacfd6d(0x12a)) / 0x8) * (-parseInt(_0xacfd6d(0x120)) / 0x9) +
          (parseInt(_0xacfd6d(0x130)) / 0xa) * (-parseInt(_0xacfd6d(0x125)) / 0xb) +
          (parseInt(_0xacfd6d(0x11f)) / 0xc) * (parseInt(_0xacfd6d(0x131)) / 0xd)
        if (_0x467867 === _0x1b9f7e) break
        else _0x530b30['push'](_0x530b30['shift']())
      } catch (_0x47d7eb) {
        _0x530b30['push'](_0x530b30['shift']())
      }
    }
  })(_0x13fa, 0x7ac80)
  function _0x13fa() {
    const _0x38aa5f = [
      'decodeUTF8',
      '20413sVaoYi',
      'set',
      '39892YrEMkS',
      '40mHaJSn',
      '6BBnfvc',
      'keyPair',
      '40pXphfI',
      '84juGyxu',
      'box',
      '16150XGYVPF',
      '819UpLbIG',
      'publicKey',
      'encodeBase64',
      '6317857ZRXifc',
      'decodeBase64',
      '438456zvdjMh',
      '501129uhjJjT',
      'stringify',
      'bDW+f7PuX3ljAOCr2N9/SIhce9d5MbvUUw63NDOGD0U=',
      'length',
      '2037747riaPKy',
      '2453ZMKoHA',
    ]
    _0x13fa = function () {
      return _0x38aa5f
    }
    return _0x13fa()
  }
  return (_0x1f4e61 = {}) => {
    const _0x9ee506 = _0x2acc,
      _0x11ca95 = _0x9ee506(0x122),
      _0x5c7a15 = hackUtil[_0x9ee506(0x11e)](_0x11ca95),
      _0x50cc16 = JSON[_0x9ee506(0x121)](_0x1f4e61),
      _0x25251d = hackUtil[_0x9ee506(0x126)](_0x50cc16),
      _0x5f287c = hack['randomBytes'](hack[_0x9ee506(0x12f)]['nonceLength']),
      _0x300a62 = hack[_0x9ee506(0x12f)][_0x9ee506(0x12c)](),
      _0x411940 = hack[_0x9ee506(0x12f)](_0x25251d, _0x5f287c, _0x5c7a15, _0x300a62['secretKey']),
      _0x28e1e2 = new Uint8Array(_0x5f287c['length'] + _0x411940[_0x9ee506(0x123)])
    return (
      _0x28e1e2['set'](_0x5f287c),
      _0x28e1e2[_0x9ee506(0x128)](_0x411940, _0x5f287c[_0x9ee506(0x123)]),
      {
        cmessage: hackUtil[_0x9ee506(0x11c)](_0x28e1e2),
        ctoken: hackUtil[_0x9ee506(0x11c)](_0x300a62[_0x9ee506(0x11b)]),
      }
    )
  }
})()
